package com.ycz.pattern.behaviour.observerpattern;

/**
 * @Description
 * @ClassName HexObserver
 * @Author yanchengzhi
 * @date 2023.10.20 02:03
 */
public class HexObserver extends Observer {

    public HexObserver(Subject subject) {
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("十六进制字符串：" + Integer.toHexString(subject.getState()).toUpperCase());
    }
}
